#include <memory>
#include "UDPSever.hpp"
#include "User.hpp"
int main()
{
    //用户管理模块
    std::shared_ptr<UserManage> um =std::make_shared<UserManage>();

    //网络服务模块
    std::unique_ptr<UDPSever> us_ptr = std::make_unique<UDPSever>();
    us_ptr->Regester([&um](InetAddr &user){ um->AddUser(user); },
                     [&um](int sockfd, const std::string &message){ um->Router(sockfd, message);},
                     [&um](InetAddr &user){ um->DeleteUser(user);}
    );
    us_ptr->Run();
    return 0;
}